<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title></title>
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@2.5/lib/index.css">
		<link rel="stylesheet" href="../css/global.css">
		<link rel="stylesheet" href="../css/chatlist.css">
		<script src="../js/flexble.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11"></script>
		<script src="https://cdn.jsdelivr.net/npm/vant@2.5/lib/vant.min.js"></script>
		<script type="text/javascript" src="../sdk/webimSDK3.1.2.js"></script>
		<script type="text/javascript" src="../js/WebIMConfig.js"></script>
		<script type="text/javascript" src="../js/webconn.js"></script>
		<script type="text/javascript" src="../js/localstorage.js"></script>
		<script type="text/javascript" src="../utils/msgtype.js"></script>
		<script type="text/javascript" src="../utils/login.js"></script>
		<script type="text/javascript" src="../utils/dialog.js"></script>
	</head>
	<body>
		<div id="bigbox" class="chatPageBox">
			<div class="friendchatbox">
				<van-button 
				class="chatlistbox" 
				type="default" 
				@click="tochat(item)"
				v-for="(item,index) in friendshowList"
				:key="index"
				>
					<div class="avatarbox">
						<van-tag v-if="!item.ishidden" class="noreadbox" round type="danger">{{item.noreadnum}}</van-tag>
						<img class="avatar" src="../img/avatar.jpg">
					</div>
					<div class="chatlist_rightbox">
						<div class="chatlistmidbox">
							<p class="chatname">{{item.name}}</p>
							<p class="chatlastmes">{{item.lastmsg}}</p>
						</div>
						<p class="chattime">15：00</p>
					</div>
				</van-button>
			</div>
			
			<div class="footerbox">
				<div class="footinner">
					<van-tag v-if="allnoreadnumshow>0" class="foot_noreadbox" round type="danger">{{allnoreadnumshow}}</van-tag>
					<img class="left_icon1" src="../img/left_icon_ac1.png">
					<p class="footcurrent">聊天</p>
				</div>
				<div class="footinner" @click="gourl('addressbook.html')">
					<van-tag v-if="newfriendnum>0" class="foot_noreadbox" round type="danger">{{newfriendnum}}</van-tag>
					<img class="left_icon3" src="../img/left_icon3.png">
					<p>通讯录</p>
				</div>
				<div class="footinner" @click="gourl('me.html')">
					<img class="left_icon4" src="../img/left_icon4.png">
					<p>我</p>
				</div>
			</div>
		</div> 
	</body>
</html>
<script type="text/javascript">
WebIM.message = WebIM.default.message;
var webvue = new Vue({
	el: '#bigbox',
	data() {
		return {
			friendshowList:getfriendshowList(),
			allnoreadnumshow:0,
			newfriendnum:0
		}
	},
	mounted(){
		isfirst = 1;
		relogin();
		this.allnoreadnumshow = getStorage('allnoreadnumshow');
		this.newfriendnum = getStorage('newfriendnum');
	},
	methods:{
		gourl(url,item){
			window.location.href = url;
		},
		tochat(item){
			saveStorage('pagedata',item)
			reduceallnoreadnum(item.noreadnum)
			removeStorage('allnoreadnumshow')
			window.location.href = 'chatpage.html';
		},
	}
})
</script>